package com.xy.lang.enums;

import com.xy.lang.domain.KeyValue;

/**
 * 占用状态
 */
public enum OccupyStatusEnum implements CodeEnum {

    FREE(1, "空闲"),
    USING(2, "占用");

    private int code;
    private String name;

    OccupyStatusEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    @Override
    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public KeyValue<Integer, String> toKeyValue() {
        return new KeyValue<>(this.code, this.name);
    }

}
